-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/download in stream mode #755
Feature/download in stream mode #755
Conversation
@lonng PTAL. BTW, is there any way to run GitHub CI Actions locally, or should we write some scripts to run the e2e test locally? |
@9547 Yes, you can run the integration locally. e.g:
|
Codecov Report
@@ Coverage Diff @@
## master #755 +/- ##
==========================================
+ Coverage 52.39% 52.50% +0.11%
==========================================
Files 262 262
Lines 18840 18876 +36
==========================================
+ Hits 9871 9911 +40
+ Misses 7432 7414 -18
- Partials 1537 1551 +14
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
73653b5
to
8c22ea8
Compare
@9547 Do you have any idea about the failed test? Or do you need help? |
Your tests failed because we didn't call |
3025d75
to
281f240
Compare
check and fixed |
@lucklove Seems the test case failed by two reasons:
|
@9547 I rerun the tests and the only failure is that local package can't be found. This is because you didn't move the downloaded package to correct path/name after |
/run-all-tests |
@lucklove Sorry, a new test case failed, but running it locally is fine. This test also failed strangely, the log said 5m 6s
GOROOT: /opt/hostedtoolcache/go/1.14.9/x64
Run export PATH=$PATH:/home/runner/work/tiup/tiup/go/src/github.com/pingcap/tiup/bin/
export PATH=$PATH:/home/runner/work/tiup/tiup/go/src/github.com/pingcap/tiup/bin/
bash /home/runner/work/tiup/tiup/go/src/github.com/pingcap/tiup/tests/tiup-playground/test_playground.sh
shell: /bin/bash -e {0}
env:
working-directory: /home/runner/work/tiup/tiup/go/src/github.com/pingcap/tiup
GOROOT: /opt/hostedtoolcache/go/1.14.9/x64
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 7275 100 7275 0 0 16609 0 --:--:-- --:--:-- --:--:-- 16609
##[error]Process completed with exit code 124. |
@9547 Yes, I agree with you. It may be the problem of |
@9547 catch it. You can replay this locally:
It's also the mirror problem... We forget open the mirror in the function |
Thanks for the advice,I'll reproduce and fix it tonight, mayb add more unit test cases |
360fafe
to
fe7e943
Compare
@lucklove FINALLY all tests passed, thanks for your kindly help. One more thing, If I run make unit-test
mkdir -p cover
TIUP_HOME=/home/.go/src/github.com/pingcap/tiup/tests/tiup GO111MODULE=on CGO_ENABLED=1 GO111MODULE=on CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go test -p 3 ./... -covermode=count -coverprofile cover/cov.unit-test.out
...
----------------------------------------------------------------------
PANIC: init_config_test.go:73: initConfigSuite.TestCheckConfig
... Panic: runtime error: invalid memory address or nil pointer dereference (PC=0x434745)
/usr/local/go/src/runtime/panic.go:969
in gopanic
/usr/local/go/src/runtime/panic.go:212
in panicmem
/usr/local/go/src/runtime/signal_unix.go:695
in sigpanic
task.go:115
in Context.GetExecutor
init_config.go:40
in InitConfig.Execute
init_config_test.go:97
in initConfigSuite.TestCheckConfig
/usr/local/go/src/reflect/value.go:321
in Value.Call
/home/.go/pkg/mod/github.com/pingcap/[email protected]/check.go:850
in suiteRunner.forkTest.func1
/home/.go/pkg/mod/github.com/pingcap/[email protected]/check.go:739
in suiteRunner.forkCall.func1
/usr/local/go/src/runtime/asm_amd64.s:1373
in goexit
OOPS: 0 passed, 1 PANICKED
--- FAIL: Test (0.00s)
FAIL
coverage: 0.9% of statements |
|
||
targetDir := filepath.Join(r.local.TargetRootDir(), localdata.ComponentParentDir, spec.ID, spec.Version) | ||
target := filepath.Join(targetDir, versionItem.URL) | ||
err = r.DownloadComponent(versionItem, target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should delete the target file when the component installed successfully.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the advice, rm the target by default, and add an env named TIUP_KEEP_SOURCE_TARGET
to keep the source target(maybe used for debugging propose).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
Awesome works.
This test case assumes you need to run |
Use |
// the component will be removed if hash is not correct | ||
func (r *V1Repository) DownloadComponent(item *v1manifest.VersionItem, target string) error { | ||
targetDir := filepath.Dir(target) | ||
err := r.mirror.Download(item.URL, targetDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems we assume item.URL
just a filename, but it may be /a/b/c/name
, but we have no such manifest yet
not introduce by this pr, seems the master code do this.
@lucklove PTAL
3cfbc85
to
ac0bcff
Compare
@lucklove sorry to bother you again, In my local env, the tls related test case( Starting component tidb
Starting instance tidb 172.19.0.102:4000
Starting instance tidb 172.19.0.101:4000
Start tidb 172.19.0.102:4000 success
retry error: operation timed out after 2m0s
tidb 172.19.0.101:4000 failed to start: timed out waiting for port 4000 to be started after 2m0s, please check the log of the instance
Error: failed to start tidb: tidb 172.19.0.101:4000 failed to start: timed out waiting for port 4000 to be started after 2m0s, please check the log of the instance: timed out waiting for port 4000 to be started after 2m0s
Verbose debug logs has been written to /tiup-cluster/tests/tiup-cluster/logs/tiup-cluster-debug-2020-09-21-22-59-31.log. Checking the TiDB 172.19.0.101:4000's failed log, shows the TiKV/TiDB can't connected to PD, seems connecting to the SSL certificate failure: eg: log/tidb.log [2020/09/21 22:57:31.230 +00:00] [FATAL] [misc.go:512] ["could not load cluster ssl"] [error="failed to append ca certs"] [stack="github.com/pingcap/tidb/util.initInternalClient\n\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/util/misc.go:512\nsync.(*Once).doSlow\n\t/usr/local/go/src/sync/once.go:66\nsync.(*Once).Do\n\t/usr/local/go/src/sync/once.go:57\ngithub.com/pingcap/tidb/util.InternalHTTPClient\n\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/util/misc.go:499\nmain.setupLog\n\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/tidb-server/main.go:622\nmain.main\n\t/home/jenkins/agent/workspace/tidb_v4.0.4/go/src/github.com/pingcap/tidb/tidb-server/main.go:176\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"] |
@AstroProfundis PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What problem does this PR solve?
#728
What is changed and how it works?
Check List
Tests
Code changes
Side effects
Related changes
The original tar.gz file is saved, not deleted, delete it or not is a question. Currently the disk layout as below:
eg: tispark
Release notes: